<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>使用记录</title>
</head>
<body class="layui-layout-body">
<link rel="stylesheet" href="/asset/plugin/formSelects/dist/formSelects-v4.css">
    <div class="layui-body">
        <!-- 内容主体区域 -->
        <div class="body_right">
            <h4 class="nav_title">使用记录</h4>
               <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
			        <ul class="layui-tab-title">
			            <li lay-id="APPLY_LIST">申请记录</li>
			            <li class="layui-this">使用记录</li>
			        </ul>
			        <div class="layui-tab-content" >
			            <div class="layui-tab-item layui-show">
			            		<!--搜索开始-->
			            		<form action="/record/usedList.htm" class="layui-form no_bordertop" method="get">
					                <div class="layui-form-item">
					                    
					                    <div class="layui-inline">
					                        <label class="layui-form-label">申请类型</label>
					                        <div class="layui-input-inline" style="width:150px">
					                            <select name="applyType" lay-filter="aihao">
					                                <option value="">全部</option>
					                                <option value="USED_APPLY" <#if query.applyType=='USED_APPLY'>selected=""</#if>>申请使用</option>
					                                <option value="TAKE_APPLY" <#if query.applyType=='TAKE_APPLY'>selected=""</#if>>申请外带</option>
					                                <option value="TEST_APPLY" <#if query.applyType=='TEST_APPLY'>selected=""</#if>>申请测试</option>
					                            </select>
					                        </div>
					                    </div>
					                    
					                    <div class="layui-inline">
					                        <label class="layui-form-label">状态</label>
					                        <div class="layui-input-inline" style="width:150px">
					                            <select name="usedStatus" lay-filter="aihao">
					                                <option value="">全部</option>
					                                <option value="WAIT_UPLOAD_CERT" <#if query.applyType=='WAIT_UPLOAD_CERT'>selected=""</#if>>待完善</option>
					                                <option value="SUCCESS" <#if query.applyType=='SUCCESS'>selected=""</#if>>成功</option>
					                                <option value="ERROR" <#if query.applyType=='ERROR'>selected=""</#if>>失败</option>
					                            </select>
					                        </div>
					                    </div>
					                    
					                    <div class="layui-inline">
					                        <label class="layui-form-label">申请人</label>
					                        <div class="layui-input-inline" style="width:150px">
					                        	<input type="hidden" name="searchType" value="NAME_AND_MOBILE">
					                            <input type="text" class="layui-input" name="searchKey" id="" value="" placeholder="姓名或手机号">
					                        </div>
					                    </div>
					                </div>
					                <div class="layui-form-item">
					                	<div class="layui-inline">
					                    		<label class="layui-form-label">申请时间</label>
					                        <div class="layui-input-inline" style="width:100px">
					                            <input type="text" class="layui-input" name="startTime" id="startTime" autocomplete="off" value="<#if query.startTime??>${query.startTime?string('yyyy-MM-dd')}</#if>" placeholder="开始时间">
					                        </div>
					                        <div class="layui-form-mid">-</div>
					                        <div class="layui-input-inline" style="width:100px">
					                            <input type="text" class="layui-input" name="endTime" id="endTime" autocomplete="off" value="<#if query.endTime??>${query.endTime?string('yyyy-MM-dd')}</#if>" placeholder="结束时间">
					                        </div>
					                    </div>
					                    
					                    <div class="layui-inline">
					                        <label class="layui-form-label">印章</label>
					                        <div class="layui-input-inline" style="width:250px">
					                            <select name="sealIds" xm-select="selectSeals" xm-select-show-count="1">
										          <option value="">请选印章</option>
										        </select>
					                            
					                        </div>
					                    </div>
					                    
					                    <div class="layui-inline">
					                        <div class="layui-input-inline ">
					                            <button class="layui-btn" lay-submit="" lay-filter="submit" ><i class="layui-icon"></i>搜索</button>
					                            <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="export" ><i class="layui-icon"></i>导出</button>
					                        </div>
					                    </div>
					                </div>
					                
					            </form>
			            		<!--搜索结束-->
		            			 
	            			  	<table class="layui-table mytable" lay-even="" lay-skin="nob">
			                    <thead>
			                    <tr>
			                        <th>使用时间</th>
			                        <th>申请时间</th>
			                        <th>申请类型</th>
			                        <th>使用印章</th>
			                        <th>使用设备</th>
			                        <th>使用地点</th>
			                        <th>使用人</th>
			                        <th>状态</th>
			                        <th>操作</th>
			                    </tr>
			                    </thead>
			                    <tbody>
			                    <#list pm.datas as item>
			                    <tr>
			                        <td>${item.usedTime?string('yyyy-MM-dd HH:mm:ss')}</td>
			                        <td>${item.applyTime?string('yyyy-MM-dd HH:mm:ss')}</td>
			                        <td>
			                        		<@linkage type="APPLY_TYPE" key=item.applyType>
								        		<span class="${linkage.style}">${linkage.name}</span>
								        	</@linkage>
			                        </td>
			                        <td>${item.seal.sealName}</td>
			                        <td>${item.devices.devicesCode}</td>
			                        <td>${item.usedAddr}</td>
			                        <td>${item.person.name}</td>
			                        <td>
			                        		<@linkage type="USED_STATUS" key=item.usedStatus>
								        		<span class="${linkage.style}">${linkage.name}</span>
								        	</@linkage>
			                        </td>
			                        <td>
			                        	<a href="javascript:openwinx('使用详情','/record/usedInfo.htm?devicesUsedId=${item.devicesUsedId}',800,600)">查看</a>
			                        </td>
			                    </tr>
			                    </#list>
			                    
			                    </tbody>
			                </table>
			                <@p.page pm=pm></@p.page>
		                </div>
		            </div>
		       </div>
        </div>
     </div>
  
     
	<script>
	
layui.config({
	        base: '/asset/plugin/formSelects/dist/' //此处路径请自行处理, 可以使用绝对路径
	    }).extend({
	        formSelects: 'formSelects-v4'
	    });	
	
	
layui.use(['upload','element','formSelects','laydate'], function(){
  var $ = layui.jquery
  ,upload = layui.upload
  ,element = layui.element
  ,formSelects = layui.formSelects
  ,laydate = layui.laydate;
  
  
  	element.on('tab(docDemoTabBrief)', function(elem){
  		var id = $(this).attr('lay-id');
  		
  		
  		if(id == 'APPLY_LIST'){
  			location.href='/record/applyList.htm';
  		}
	});
  
    formSelects.data('selectSeals', 'server', {
	            url: '/seal/getAll.htm'
   });
   
   
   laydate.render({
		    elem: '#startTime'
		  });
		  
		  laydate.render({
		    elem: '#endTime',
		    min:$("#startTime").val()
		  });
  
  
  	form.on('submit(submit)', function(data){
	   
	   	data.form.action="/record/usedList.htm"
	   
	});
	
	form.on('submit(export)', function(data){
	   
	    data.form.action="/record/usedExport.htm"
	    data.form.submit();
	    console.log(data);
	    console.log(form);
	    return false;
	    
	});
  
  
   
  
});
	
	
        
    </script>     
</body>
</html>